﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

public partial class apps_ahmic_pages_AHMHRIRSF01 : System.Web.UI.Page
{
    string vappid = "AHMIC";
    string vformid = "AHMIC_AHMHRIRSF05";

    protected void Page_Load(object sender, EventArgs e)
    {
        if (AHMIDEAFunctions.IsFunctionAuthorized(HttpContext.Current, vappid, vformid, "OPEN"))
        {
            formHeader.InnerHtml = AHMIDEAFunctions.GetFormHeader(vappid, vformid);
            HtmlSelect sarea = (HtmlSelect)filter_area;
            sarea.Items.Add(new ListItem("Semua Area", ""));
            using (DC_AHMHRIRSDataContext dc = new DC_AHMHRIRSDataContext())
            {
                var a = from i in dc.AHMHRIRS_HDRAREAs where i.istatus == 1 select i;
                foreach (var item in a)
                {
                    sarea.Items.Add(new ListItem(item.vareadesc, item.vareaid.ToString()));
                }
            }

            // default value
            if (!string.IsNullOrEmpty(Request["filter_nrp"]))
            {
                ((HtmlInputText)filter_nrp).Value = Request["filter_nrp"];
            }
            if (!string.IsNullOrEmpty(Request["filter_area"]))
            {
                sarea.Value = Request["filter_area"];
            }


        }
        else
        {
            formContentOuter.InnerHtml = AHMIDEAFunctions.GetFormNotAuthorizedHeader();
        }
    }
}